﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="ImageViewerWPF.MainWindow"
        Title="ImageViewer" d:DesignWidth="614.5" d:DesignHeight="449" WindowStyle="None">
	<Window.Resources>
		<ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
			<VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
		</ItemsPanelTemplate>
	</Window.Resources>
    <Grid
        MouseLeftButtonDown="Grid_MouseLeftButtonDown">
    	<Grid.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="#FF1F1F1F" Offset="0"/>
    			<GradientStop Color="#FF9B9B9B" Offset="1"/>
    		</LinearGradientBrush>
    	</Grid.Background>
        <Grid.RowDefinitions>
        	<RowDefinition Height="0.5*" />
        	<RowDefinition Height="0.5*"/>
        	<RowDefinition
        		Height="116" />
        </Grid.RowDefinitions>
    	<ListBox x:Name="listBox" HorizontalAlignment="Left" Margin="8,8,0,8" Grid.Row="2" ItemsPanel="{DynamicResource ItemsPanelTemplate1}" Background="{x:Null}" IsSynchronizedWithCurrentItem="True" ScrollViewer.VerticalScrollBarVisibility="Disabled" SelectedIndex="0">
    		<Image Source="Assets/1.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/2.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/3.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/4.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/5.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/6.JPG" Stretch="Fill" Width="120" Height="80"/>
    		<Image Source="Assets/7.JPG" Stretch="Fill" Width="120" Height="80"/>
    	</ListBox>
    	<Image Margin="40,8,40,0" DataContext="{Binding SelectedItem, ElementName=listBox}" Source="{Binding Source}">
    		<Image.Effect>
    			<DropShadowEffect/>
    		</Image.Effect>
    	</Image>
    	<Image Margin="40,0,40,8" DataContext="{Binding SelectedItem, ElementName=listBox}" Source="{Binding Source}" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
    		<Image.Effect>
    			<DropShadowEffect/>
    		</Image.Effect>
    		<Image.OpacityMask>
    			<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    				<GradientStop Color="#00000000" Offset="0.182"/>
    				<GradientStop Color="White" Offset="1"/>
    			</LinearGradientBrush>
    		</Image.OpacityMask>
    		<Image.RenderTransform>
    			<TransformGroup>
    				<ScaleTransform ScaleY="-1"/>
    				<SkewTransform/>
    				<RotateTransform/>
    				<TranslateTransform/>
    			</TransformGroup>
    		</Image.RenderTransform>
    	</Image>
    	<Button Content="X" HorizontalAlignment="Right" Height="25" Margin="0,8,8,0" VerticalAlignment="Top" Width="25" BorderBrush="Red" Foreground="Red" Background="#3F000000"
            Click="Button_Click" />
    </Grid>
</Window>
